package com.lzq.train.business.controller.web;

import com.lzq.train.business.req.DailyTrainStationQueryAll;
import com.lzq.train.business.resp.DailyTrainStationQueryResp;
import com.lzq.train.business.service.DailyTrainStationService;
import com.lzq.train.common.resp.CommonResp;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author lzq
 * @date 2023/7/14 21:09
 */

@RestController
@RequestMapping("web/daily-train-station")
public class DailyTrainStationController {

    @Resource
    private DailyTrainStationService dailyTrainStationService;

    /**
     * 查询火车经过的车站
     * @param req
     * @return
     */
    @GetMapping("/query-by-train-code")
    public CommonResp<List<DailyTrainStationQueryResp>> queryList(@Valid DailyTrainStationQueryAll req) {
        List<DailyTrainStationQueryResp> list = dailyTrainStationService.queryByTrain(req);
        return new CommonResp<>(list);
    }
}
